package cn.com.xy.sms.sdk.util;

import java.util.concurrent.ExecutorService;

import cn.com.xy.sms.sdk.db.entity.NumberInfoManager;
import cn.com.xy.sms.sdk.number.LocationRunnable;
import cn.com.xy.sms.sdk.number.ReparseNumberRunnable;
import cn.com.xy.sms.sdk.number.UpgradeEmbedRunnable;
import cn.com.xy.sms.sdk.number.UploadUserTagRunnable;

/* SDK-428 huangzhiqiang 20160607 start */
public class RunnableManager {
    /* IMOO-13 likuangkuang 20161017 start */
    public static final BaseRunnable REPARSE_NO_NETWORK_NUM_INFO = ReparseNumberRunnable.getInstance(
            NumberInfoManager.TYPE_REPARSE_NO_NETWORK_NUM_INFO);
    public static final BaseRunnable REPARSE_INVALID_NUM_INFO = ReparseNumberRunnable.getInstance(
            NumberInfoManager.TYPE_REPARSE_INVALID_NUM_INFO);
    public static final BaseRunnable REPARSE_EXPIRED_NUM_INFO = ReparseNumberRunnable.getInstance(
            NumberInfoManager.TYPE_REPARSE_EXPIRED_NUM_INFO);
    public static final BaseRunnable UPLOAD_USER_TAG = UploadUserTagRunnable.getInstance();
    public static final BaseRunnable LOCATION = LocationRunnable.getInstance();
	/* IMOO-9 likuangkuang 20161014 start */
	public static final BaseRunnable OTA_EMBED_NUMBER = UpgradeEmbedRunnable.getInstance();
	/* IMOO-9 likuangkuang 20161014 end */
	/* IMOO-13 likuangkuang 20161017 end */
	
    public static void executeRunnableByPool(ExecutorService executorService, BaseRunnable runnable) {
        if (executorService == null || runnable == null || runnable.isRunning()) {
            return;
        }
        
        executorService.execute(runnable);
    }
}
/* SDK-428 huangzhiqiang 20160607 end */